import { PROJECT_PREFIX } from '../../../../../../types/constants'
import { SYMBOLS } from '../../../../../../types/interfaces'

export function styles(): string {
  return `
.gf-stats-panel {
  display: flex;
  flex-direction: column;
  background: var(--${PROJECT_PREFIX}-theme-bg-base) !important;
  
  .stats-action-buttons {
    display: flex;
    gap: 16px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 12px;
    
    button {
      .gf-icon-refresh::before {
        content: "${SYMBOLS.ARROWS.CIRCLE}";
      }
      
      .gf-icon-clear::before {
        content: "${SYMBOLS.UI.CLOSE}";
      }
    }
    
    .gf-icon-refresh,
    .gf-icon-clear {
      margin-right: 6px;
      font-size: 14px;
    }
  }

  .stats-section {
    background: var(--${PROJECT_PREFIX}-theme-bg-base) !important;
    padding: 1rem;
    
    .gf-remove-mark-btn {
      background-color: #6c757d !important;
      color: white !important;
      border: none !important;
      outline: none !important;
      transition: all 0.3s;
      border-radius: 5px;
      padding: .2em 0.4em !important;
      cursor: pointer;
      font-size: 12px !important;
      font-weight: 500 !important;
      
      &:hover {
        background-color: #5a6268 !important;
        box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.3);
      }
    }
    
    .stats-subsection {
      margin-left: 1rem;
      margin-top: 0.5rem;
      
      h4 {
        color: #2c3e50;
        font-size: 1rem;
        margin: 0.5rem 0;
      }
    }
    
    .feedback-stats-charts {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
    }
    
    li {
      margin: 0.5rem;
      list-style: none;
      &::marker {
        color: #888;
      }
    }
  }
  .stats-label {
    color: var(--${PROJECT_PREFIX}-theme-text-secondary) !important;
    font-weight: 600;
  }
  
  .stats-value {
    color: var(--${PROJECT_PREFIX}-theme-text-secondary) !important;
    
    .stats-links {
      list-style-type: none;
      padding-left: 1rem;
      margin-top: 0.3rem;

      a {
        &::before {
          content: "${SYMBOLS.ARROWS.UP_RIGHT}";
          font-size: 0.8em;
          opacity: 0.7;
        }
      }
    }
  }
}

/* 紧凑模式 */
.gf-stats-panel.compact {
  .stats-section {
    padding: 0.5rem;
    margin-bottom: 0.8rem;
  }
  
  h3 {
    font-size: 1rem;
  }

  .stats-links {
    display: none;
  }
}
`
}
